//
//  card_Info.m
//  MOSAD_HW2
//
//  Created by wenjy23 on 2020/11/10.
//  Copyright © 2020 wenjy23. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "card_info.h"

@implementation card_info

- (UIImage *)getPhotoByIndex:(int)i{
    return self->photos[i];
}

-(NSInteger)getPhotoNum{
    return photo_num;
}

-(id)init{
    self = [super init];
    if (self) {
        self->time = self->spot = self->place = self->experience = @"";
        self->photos = [[NSMutableArray alloc] init];
    }
    return self;
}

-(void)setTime:(NSString*) tmp_time {
    self->time = tmp_time;
}

-(void)setSpot:(NSString*) tmp_spot {
    self->spot = tmp_spot;
}

-(void)setPlace:(NSString*) tmp_place {
    self->place = tmp_place;
}

-(void)setExperience:(NSString *)tmp_experience{
    self->experience = tmp_experience;
}

-(void)setLikeNum:(NSInteger)tmpLikeNum{
    self->likeNum = tmpLikeNum;
}

- (void)setCommentNum:(NSInteger)tmpCommentNum {
    self->commentNum = tmpCommentNum;
}

-(void)setPhotos:(NSMutableArray *)tmp_photos {
    NSLog(@"%ldhereherhe\n", tmp_photos.count);
    for (int i = 0; i < tmp_photos.count; i++) {
        [self->photos addObject:tmp_photos[i]];
    }
    photo_num = tmp_photos.count;
}

- (NSString*) getTime {
    return self->time;
}

- (NSString *)getPlace {
    return self->place;
}

- (NSString *)getExperience {
    return self->experience;
}

- (NSString *)getSpot {
    return self->spot;
}

- (NSInteger)getLikeNum {
    return self->likeNum;
}

- (NSInteger)getCommentNum {
    return self->commentNum;
}

@end
